﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TPTRawDataView.aspx.cs" Inherits="MLY.LTR.TPTRawDataView1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>TPT raw data</title>
    <style type="text/css">
        .TitleStyle
        {
            font-family:Arial Sans-Serif David;
            font-size:14px;
            font-weight:bold;
            color:Black;
            background-color:#86C2FF;
            padding:5px 5px 5px 5px;           
        }
        .InerTextStyle
        {
            font-family:Arial Sans-Serif David;
            font-size:12px;
            color:Black;
        }
    </style>

    <script src="../TableSorter/jquery-latest.js" type="text/javascript"></script>
    <script src="../TableSorter/jquery.tablesorter.js" type="text/javascript"></script>
    
</head>
<body>
<form id="form1" runat="server">
<div>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    
    <asp:UpdatePanel ID="UpdatePanel" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
        <b><asp:Label ID="ActualTitleLabel" runat="server" CssClass="InerTextStyle" Text="TPT Raw data view"></asp:Label></b>
        <br /><br />
        
        <table cellpadding="5" cellspacing="0">
        <tr>
        <td>
            <asp:Label ID="PickDateTitleLabel" runat="server" Text="Fiter by date." CssClass="InerTextStyle"></asp:Label>
        </td>
        <td>
            <asp:Label ID="FromDateTitleLabel" runat="server" Text="From:" CssClass="InerTextStyle"></asp:Label>
            &nbsp;
            <asp:DropDownList ID="DatesFromDDL" runat="server" DataSourceID="DatesDataSource" 
            DataTextField="FormattedDate" DataValueField="Date" AutoPostBack="true" OnSelectedIndexChanged="RefreshData">
            </asp:DropDownList>
            &nbsp;
            <asp:Label ID="TillDateTitleLabel" runat="server" Text="Till" CssClass="InerTextStyle"></asp:Label>
            &nbsp;
            <asp:DropDownList ID="DatesTillDDL" runat="server" DataSourceID="DatesDataSource" 
            DataTextField="FormattedDate" DataValueField="Date" AutoPostBack="true" OnSelectedIndexChanged="RefreshData">
            </asp:DropDownList>
        </td>
        </tr>
        <tr>
        <td><asp:Label ID="PickOldLifeCycleStage" runat="server" Text="Filter by old life cycle stage:" CssClass="InerTextStyle"></asp:Label></td>
        <td><asp:DropDownList ID="OldLifeCycleStageDDL" runat="server" AutoPostBack="true" OnSelectedIndexChanged="RefreshData">
            <asp:ListItem Selected="True" Value="1000" Text="All"></asp:ListItem>
            <asp:ListItem Text="New" Value="0"></asp:ListItem>
            <asp:ListItem Text="Before_0_Order" Value="1"></asp:ListItem>
            <asp:ListItem Text="Wait_For_Quote" Value="2"></asp:ListItem>
            <asp:ListItem Text="Wait_for_customer_Approval" Value="3"></asp:ListItem>
            <asp:ListItem Text="Wait_for_order" Value="4"></asp:ListItem>
            <asp:ListItem Text="Completed" Value="5"></asp:ListItem>
            <asp:ListItem Text="Undefined" Value="99"></asp:ListItem>
        </asp:DropDownList></td>
        </tr>
        <tr>
        <td><asp:Label ID="PickNewLifeCycleStage" runat="server" Text="Filter by new life cycle stage:" CssClass="InerTextStyle"></asp:Label></td>
        <td><asp:DropDownList ID="NewLifeCycleStageDDL" runat="server" AutoPostBack="true" OnSelectedIndexChanged="RefreshData">
            <asp:ListItem Selected="True" Value="0" Text="All"></asp:ListItem>
            <asp:ListItem Text="Before_0_Order" Value="1"></asp:ListItem>
            <asp:ListItem Text="Wait_For_Quote" Value="2"></asp:ListItem>
            <asp:ListItem Text="Wait_for_customer_Approval" Value="3"></asp:ListItem>
            <asp:ListItem Text="Wait_for_order" Value="4"></asp:ListItem>
            <asp:ListItem Text="Completed" Value="5"></asp:ListItem>
            <asp:ListItem Text="Undefined" Value="99"></asp:ListItem>
        </asp:DropDownList></td>
        </tr>
        <tr>
        <td><asp:Label ID="WorkOrderIdPickTitleLabel" runat="server" Text="Filter by work order id:" CssClass="InerTextStyle"></asp:Label></td>
        <td><asp:DropDownList ID="WorkOrderIdDDL" runat="server" DataSourceID="WorkOrderIdsDataSource"
         DataTextField="WorkOrderId" DataValueField="WorkOrderId" AutoPostBack="true" OnSelectedIndexChanged="RefreshData">
        </asp:DropDownList></td>
        </tr>
        </table>
        
        <asp:ImageButton ID="ExportToExcel1" runat="server" ImageUrl="~/Images/excel.gif" OnClick="ExportToExcel" />
        <br />
        <div style="position:absolute; margin:100px 100px 100px 100px; ">
        <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel">
        <ProgressTemplate>
            <asp:Image ID="ProgressImage" runat="server" ImageUrl="~/Images/AjaxLoadingIcon.gif" />
        </ProgressTemplate>
        </asp:UpdateProgress>
        </div>
        
        <asp:SqlDataSource ID="DatesDataSource" runat="server" SelectCommandType="StoredProcedure"
        ConnectionString="<%$ ConnectionStrings:MLYConnectionString %>" SelectCommand="TPT_RawDataDates"></asp:SqlDataSource> 
        <asp:SqlDataSource ID="WorkOrderIdsDataSource" runat="server" SelectCommandType="StoredProcedure"
        ConnectionString="<%$ ConnectionStrings:MLYConnectionString %>" SelectCommand="TPT_RawDataWorkOrderIds"></asp:SqlDataSource> 
        <br /> 
        
        <asp:GridView ID="RawDataGridview" runat="server" AutoGenerateColumns="true" DataSourceID="TPTRawDataSource"
         UseAccessibleHeader="true" AllowPaging="true" PageSize="100" CellPadding="5" >
         <HeaderStyle CssClass="TitleStyle"/>
         <RowStyle CssClass="InerTextStyle" />
        </asp:GridView>
          
        <asp:SqlDataSource ID="TPTRawDataSource" runat="server" SelectCommandType="StoredProcedure"
        ConnectionString="<%$ ConnectionStrings:MLYConnectionString %>" SelectCommand="TPT_RawDataView">
        </asp:SqlDataSource>  
    </ContentTemplate>
    <Triggers>
        <asp:PostBackTrigger ControlID="ExportToExcel1" />
    </Triggers>
    </asp:UpdatePanel>
</div>
</form>
</body>
</html>
